const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.code 编号
 * @param {} options.name 名称
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        code: req.query.code,
        name: req.query.name
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id1644',
                    code: 'code1645',
                    name: 'name1646',
                    description: 'description',
                    options: [
                        'update'
                    ],
                    rowVersion: 'rowVersion'
                },
                {
                    id: 'id1647',
                    code: 'code1648',
                    name: 'name1649',
                    description: 'description',
                    options: [
                        'update'
                    ],
                    rowVersion: 'rowVersion'
                }
            ],
            totalElements: 50
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修模式Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id 维修模式Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/abandon', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/import', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.sortField 排序字段
 * @param {} options.isDesc 倒序排列
 * @throws {Error}
 * @return {Promise}
 */
router.get('/export', async(req, res, next) => {
    const options = {
        sortField: req.query.sortField,
        isDesc: req.query.isDesc
    };
    const data = {
        message: 'message',
        payload: 'payload'
    };
    res.json(data);
});
module.exports = router;
